//package com.luanye.enjoy.flowable.task;
//
//import com.alibaba.fastjson.JSON;
//import com.luanye.enjoy.config.SpringUtilConfig;
//import com.luanye.enjoy.dto.SmsDTO;
//import org.flowable.engine.delegate.DelegateExecution;
//import org.flowable.engine.delegate.JavaDelegate;
//import org.springframework.amqp.core.Message;
//import org.springframework.amqp.core.MessageProperties;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//import static com.luanye.enjoy.constants.MQConst.SMS_EXCHANGE;
//import static com.luanye.enjoy.constants.SmsConst.TEMPLATE_VILLAGE_REJECT;
//
//public class RecallDelegate implements JavaDelegate {
//
//    @Override
//    public void execute(DelegateExecution execution) {
//        String phone = execution.getVariable("phone", String.class);
//        String process_name = execution.getVariable("process_name", String.class);
//        String villageName = execution.getVariable("villageName", String.class);
//        String reason = execution.getVariable("reason", String.class);
//
//        SmsDTO dto = new SmsDTO(
//                phone,
//                new String[]{villageName, process_name, reason},
//                TEMPLATE_VILLAGE_REJECT
//        );
//        RabbitTemplate rabbitTemplate = SpringUtilConfig.getBean(RabbitTemplate.class);
//        rabbitTemplate.convertAndSend(SMS_EXCHANGE, "*", new Message(JSON.toJSONBytes(dto), new MessageProperties()));
//    }
//
//
//
//}
